import request from '@/utils/requestH2'

/* 资源管理 */

// 获取资源列表
export function selResourceListApi(params) {
  return request({
    url: '/resources/selResourcesInspectList',
    method: 'GET',
    params
  })
}

// 新增资源
export function addResourceApi(data) {
  return request({
    url: '/resource/addResource',
    method: 'POST',
    data
  })
}

// 根据id修改资源
export function updateResourceByIdApi(data) {
  return request({
    url: `/resource/updateResourceById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name,
      type: data.type,
      price: data.price,
      number: data.number,
      remark: data.remark
    }
  })
}

// 根据id删除资源
export function delResourceByIdApi(id) {
  return request({
    url: `/resource/delResourceById/${id}`,
    method: 'PUT'
  })
}

// 根据id处理资源
export function updateResourceStatusByIdApi(data) {
  return request({
    url: `/resource/updateResourceStatusById/${data.id}`,
    method: 'PUT',
    data
  })
}

